#include "slope1c1.h"

DIF_tstSlopeDpoolData DIF_stSlopeDpoolData = {0,0,1};


/*slope main function */
void slope_vMain(void)
{
  if (!Flg_PitchAngSign_tmout() && !Flg_PitchAng_tmout()) {
        //如果没有信号超时
        uint8 PitchAngSign = PitchAngSign_read();
        uint8 PitchAng = PitchAng_read();
        if (PitchAng >= 0x01 && PitchAng <= 0x5A) {
            if (PitchAngSign == 0x0) {
                // DIF_tstSlopeDpoolData
                stDIFSlopeDpool.DIF_u8SlopeDirectionValue = 1;
                stDIFSlopeDpool.DIF_u8SlopeAngleValue = PitchAng;
            }
            else if (PitchAngSign == 0x1) {
                stDIFSlopeDpool.DIF_u8SlopeDirectionValue = 2;
             
                stDIFSlopeDpool.DIF_u8SlopeAngleValue = PitchAng;
            }
        }

    }
    if (!Flg_PitchAng_tmout()) {
        uint8 PitchAng = PitchAng_read();
        if (PitchAng == 0) {
            stDIFSlopeDpool.DIF_u8SlopeDirectionValue = 0;
            stDIFSlopeDpool.DIF_u8SlopeAngleValue = 0;
        }
    }

}
